package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.Collections;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IMessageNoteDao;
import com.financing.platform.dto.MessageNoteDTO;
import com.financing.platform.util.SqlName;


@Repository("messageNoteDaoImpl")
public class MessageNoteDaoImpl extends BaseDaoImpl implements IMessageNoteDao {

	public int addMessageNote(MessageNoteDTO messageNoteDTO)throws SQLException {
		this.sqlMapClient.insert(SqlName.addMessageNote, messageNoteDTO);
		return 1;
	}

	@SuppressWarnings("unchecked")
	public List<MessageNoteDTO> messageNoteList(MessageNoteDTO messageNoteDTO) {
		try {
			return (List<MessageNoteDTO>)this.sqlMapClient.queryForList(SqlName.queryMessageNote, messageNoteDTO);
		} catch (SQLException e) {
			log.error("Query message note list error !", e);
			return Collections.emptyList();
		}
	}


}
